﻿using System;
using System.Linq;
using System.Reflection;

namespace 自定义特性_反射
{
    internal class Program
    {
        static void Main(string[] args)
        {
            DebugClass debugClass = new DebugClass();
            Type type = typeof(DebugClass);
            // 遍历方法特性
            foreach (MethodInfo m in type.GetMethods())
            {
                foreach (Attribute a in m.GetCustomAttributes(true).Cast<Attribute>())
                {
                    CurstomAttribute dbi = (CurstomAttribute)a;
                    if (null != dbi)
                    {
                        Console.WriteLine(dbi.DevelopName);
                        Console.WriteLine(dbi.Description);
                        Console.WriteLine(dbi.Message);
                    }
                }
            }
        }
    }
}
